let video = document.getElementById("cg-video");
let input = document.getElementById("toggle");
let layer = document.getElementById("layer");

var ua = navigator.userAgent.toLowerCase();
if (/mobile|android|iphone|ipad|phone/i.test(ua)) {
   window.location.href = "https://mjdj.163.com/m/";
}


function Play() {
  if (input.checked == false) {
    video.play();
    console.log(layer.style.display);
    layer.style.display = "block";
    console.log(layer.style.display);
  }
}

function Close() {
  video.currentTime = 0;
  video.pause();
  if (input.checked == true) {
    input.checked = false;
    layer.style.display = "none";
  }
}